package leetcode.剑指offer.后40;

import org.junit.Test;

/**
 * @author :songyaozhang
 * @date :Created 2021/8/10 19:01
 * @description :https://leetcode-cn.com/problems/zuo-xuan-zhuan-zi-fu-chuan-lcof/
 */
public class 剑指_58_II_左旋转字符串 {
    @Test
    public void test() {
        Solution solution = new Solution();
        System.out.println(solution.reverseLeftWords("abcdefg", 2));
    }

    class Solution {
        public String reverseLeftWords(String s, int n) {
            StringBuilder builder = new StringBuilder(s.substring(n));
            builder.append(s.substring(0, n));
            return builder.toString();
        }
    }


}
